home *** CD-ROM | disk | FTP | other *** search
/ Erotic Games: Memory / Erotic Games: Memory.iso / mac / air_installers / AdobeAIR.exe / setup.swf / scripts / mx / collections / ArrayCollection.as next >
Text File  |  2009-02-12  |  1KB  |  62 lines

  1. package mx.collections
  2. {
  3.    import flash.utils.IDataInput;
  4.    import flash.utils.IDataOutput;
  5.    import flash.utils.IExternalizable;
  6.    import mx.core.mx_internal;
  7.    
  8.    use namespace mx_internal;
  9.    
  10.    public class ArrayCollection extends ListCollectionView implements IExternalizable
  11.    {
  12.       
  13.       mx_internal static const VERSION:String = "3.0.0.0";
  14.        
  15.       
  16.       public function ArrayCollection(param1:Array = null)
  17.       {
  18.          super();
  19.          this.source = param1;
  20.       }
  21.       
  22.       public function set source(param1:Array) : void
  23.       {
  24.          list = new ArrayList(param1);
  25.       }
  26.       
  27.       public function readExternal(param1:IDataInput) : void
  28.       {
  29.          if(list is IExternalizable)
  30.          {
  31.             IExternalizable(list).readExternal(param1);
  32.          }
  33.          else
  34.          {
  35.             source = param1.readObject() as Array;
  36.          }
  37.       }
  38.       
  39.       public function writeExternal(param1:IDataOutput) : void
  40.       {
  41.          if(list is IExternalizable)
  42.          {
  43.             IExternalizable(list).writeExternal(param1);
  44.          }
  45.          else
  46.          {
  47.             param1.writeObject(source);
  48.          }
  49.       }
  50.       
  51.       [Bindable("listChanged")]
  52.       public function get source() : Array
  53.       {
  54.          if(list && list is ArrayList)
  55.          {
  56.             return ArrayList(list).source;
  57.          }
  58.          return null;
  59.       }
  60.    }
  61. }
  62.